<template>
	<view>
		<view  v-for="(item,index) in dataList" :key="index" @click="detail(item)">
			<tui-list-cell :hover="true" :lineLeft="true" style="margin: 8px;">
        <view style="padding: 14px;">
            <view class="tui-goods-title">
                <view>{{item.billNo}}</view>
                <view class="tui-order-status">
                  <span style="color: #2d965a;">{{item.billProcStatus==='23'?'已审核':'待审核'}}</span>
                </view>
            </view>

            <view class="tui-goods-title">
                <view>
                  <span style="color: #888888">名称：</span>
                  <span>{{item.name}}</span>
                </view>

            </view>

          <view class="tui-goods-title2">
            <span style="color: #888888;padding-right: 4px;">有效期间: </span>
            {{item.effectiveDate}}
            <span style="color: #888888;padding: 0px 4px;">至</span>
            {{item.expiryDate}}
          </view>

        </view>
			</tui-list-cell>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList:[],
        pullUpOn:"",
			}
		},
		onLoad() {
			this.getsalPriceDataList();
		},
		methods: {
			getsalPriceDataList(){
				let that = this;
				let fdata = {
					pageNo: 1,
					pageSize: 10,
          loadding:"",
				};

				let pageNum = that.dataList.length;
				if (pageNum % 10 > 0) {
					this.pullUpOn = true;
					uni.stopPullDownRefresh();
					return false;
				} else {
					pageNum = (pageNum / 10) + 1
					fdata = {
						pageNo: pageNum,
						pageSize: 10,
					}
				}
				this.$http.get("/sal/salPrice/mobleList?column=createTime&order=desc",{params:fdata}).then(res=> {
					console.log("---res---",res);
					if (res.data.success) {
						if (pageNum === 1) {
							this.pullUpOn = true;
							that.dataList = res.data.result.records;
						}
						else {
							this.loadding = true;
							this.pullUpOn = false;
							that.dataList.push.apply(that.dataList, res.data.result.records);
						}
						this.loadding = false;
					}
					uni.stopPullDownRefresh();
				}).catch(e=>{
					console.log("请求错误",e)
				})
			},
			detail(e) {
				let parmas={
					is:e.id
				}
				this.$Router.push({name: 'salpricedetail',params:parmas})
			},
		}
	}
</script>

<style>
	.tui-goods-title {
		width: 100%;
		font-size: 24rpx;
    padding: 2px;
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

  .tui-goods-title2 {
    width: 100%;
    padding: 2px;
    font-size: 24rpx;
    display: flex;
    align-items: center;
  }

	.tui-order-status {
		color: #888;
		font-size: 26rpx;
	}
</style>
